package com.lanqiao.javaparkinglot.service.impl;


import com.lanqiao.javaparkinglot.dao.WliuDao;
import com.lanqiao.javaparkinglot.entity.Wliu;
import com.lanqiao.javaparkinglot.service.WliuService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WliuServiceImpl implements WliuService {

@Autowired
    WliuDao wliuDao;
    //查询
    @Override
    public List<Wliu> findAll() {
       List<Wliu> wliuList=wliuDao.findAll();
       return wliuList;
    }
    //模糊查询--货主姓名
    @Override
    public List<Wliu> findByNumber(String wl_number) {
        return wliuDao.findByNumber(wl_number);
    }
    //模糊查询--车辆类型
    @Override
    public List<Wliu> findByCar (String wl_car){
        return wliuDao.findByCar(wl_car);
    }
    //模糊查询货物类型
    @Override
    public List<Wliu> findHws(String wl_hwsstyle) {
        return wliuDao.findHws(wl_hwsstyle);
    }



    //添加
    @Override
    public void   addwliu(Wliu wliu) {
        wliuDao.addwliu(wliu );




    }
    //修改
    @Override
    public void updatewliu(Wliu wliu) {

        wliuDao.updatewliu(wliu);
    }

    //删除
    @Override
    public void deletewliu(Long wl_eno) {
        wliuDao.deletewliu(wl_eno);
    }

    @Override
    public List<Wliu> findByPage(@Param("offset")Integer offset,@Param("pageSize")Integer pageSize) {
        List<Wliu> wliuList=wliuDao.findByPage(offset,pageSize);
        return wliuList;
    }

    @Override
    public Integer countWliu() {
        return   wliuDao.countWliu();

    }


    //分页查询
//    @Override
//    public List<Wliu> findByPage() {
//        List<Wliu> wliuList= wliuDao.findByPage();
//        return wliuList;
//    }





}
